
#all内容为所有要执行的程序，make默认只执行第一项内容
all: bin/main bin/user bin/lottery bin/admin shell

#执行文件生成----------------------------------------
bin/main: src/main.c
	gcc -o $@ $^ -Wall

bin/user: obj/user.o obj/user_func.o
	gcc -o $@ $^ -Wall
obj/user.o: src/user.c
	gcc -o $@ -I include -c $^ -Wall
obj/user_func.o: src/user_func.c
	gcc -o $@ -I include -c $^ -Wall


bin/lottery: obj/lottery.o obj/lottery_func.o
	gcc -o $@ $^ -Wall
obj/lottery.o: src/lottery.c
	gcc -o $@ -I include -c $^ -Wall
obj/lottery_func.o: src/lottery_func.c
	gcc -o $@ -I include -c $^ -Wall

bin/admin: obj/admin.o obj/admin_func.o
	gcc -o $@ $^ -Wall
obj/admin.o: src/admin.c
	gcc -o $@ -I include -c $^ -Wall
obj/admin_func.o: src/admin_func.c
	gcc -o $@ -I include -c $^ -Wall
#---------------------------------------------------------
	
#调用shell脚本创建文件----------------------------------------
shell:
	bash build_data.sh
#---------------------------------------------------------

